package com.zzg.controller;

import com.zzg.entity.ShowMap;
import com.zzg.entity.Viewdata;
import com.zzg.note.AdviceAnnotation;
import com.zzg.service.Impl.ViewdataServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author zzg
 * @version 1.0.0
 * @ClassName：ViewdataController
 * @Description: 描述
 * @date 2021/7/8
 **/
@Controller
public class ViewdataController {
    @Autowired
    private ViewdataServiceImpl viewdataService;
    @AdviceAnnotation(name = "饼状视图数据展示")
    @RequestMapping(value = "/Circular",produces = "application/json;charset=utf-8")
    @ResponseBody
    public List<Viewdata> circular(){
        return viewdataService.circular();
    }
    /**
     * 财务报表
     * @author zzg
     * @date 2021/7/15 9:59
     * @params *@params
     * @return
     */
    @AdviceAnnotation(name = "查询财务图需要的数据和车辆财务需要的数据")
    @RequestMapping(value = "/FinanceWay",produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String, Object> financeWay(){
        List<Viewdata> viewdata = viewdataService.financeWay();
        List<ShowMap> showMaps = viewdataService.showWay();
        Map<String, Object> map=new HashMap<>();
        map.put("showMaps",showMaps);
        map.put("viewdata",viewdata);
        return map;
    }
    @AdviceAnnotation(name = "查询库存状态")
    @RequestMapping(value = "/MapNumeric",produces = "application/json;charset=utf-8")
    @ResponseBody
    public List<String> mapNumeric(){
        return viewdataService.mapNumeric();
    }

    @AdviceAnnotation(name = "查询运单")
    @RequestMapping(value = "/Quantity",produces = "application/json;charset=utf-8")
    @ResponseBody
    public List<Viewdata> quantity(){
        return viewdataService.quantity();
    }

}
